﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;

namespace Ex05
{
    class Program
    {
        static void Main(string[] args)
        {
            // This uses a custom 'Pair' extension method, defined below.
            var db = new NorthwindEntities();
            var enumerable = db.Customers
                .Select(c => c.Name.ToUpper()).Pair().OrderBy(n=>n).ToList();
               


            // Here's a more substantial example:

            db.Customers
                .Select(c => c.Name.ToUpper())
                .OrderBy(n => n)
                .Pair()                         // Local from this point on.
                .Select((n, i) => "Pair " + i.ToString() + " = " + n)
                .Dump();
            Console.ReadKey();
        }
    }
}
